//
//  BalanceModel.m
//  JackDeve
//
//  Created by Agensn on 2017/5/12.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "BalanceModel.h"

static BalanceModel *model;

@implementation BalanceModel

+(BalanceModel *)shareMo{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        model = [[BalanceModel alloc]init];
        [model getData];
    });
    return model;
}
-(void)getData{
    Data *da = [HomeUserDefault getUserDefault];
    NSString *url = [NSString stringWithFormat:@"%@/user/info?token=%@",ROOT_URL,da.token];
    [[Netwroking shareInstance]requestWithURL:url params:nil successBlock:^(id block) {
        NSLog(@"%@",block);
        NSString *money = [[block objectForKey:@"data"] objectForKey:@"money"];
        [[NSNotificationCenter defaultCenter]postNotificationName:@"yue" object:money];
    } failure:^(id block) {
        
    }];
}

@end
